<?php

namespace App\Models\Admin;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class SysRole extends Model
{
    use HasFactory;

    protected $hidden = ['pivot', 'deleted_at'];

    protected $fillable = ['name', 'code', 'sort', 'data_scope', 'status'];


    public function permissions()
    {
        return $this->belongsToMany(SysPermission::class, SysRolePermission::class);
    }

    public function menus()
    {
        return $this->belongsToMany(SysMenu::class, SysRoleMenu::class);
    }
}
